package com.yc.damai.mapper;

import com.yc.damai.entity.Cart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2022-11-01
 */
public interface CartMapper extends BaseMapper<Cart> {

    @Select("select a.*," +
            " b.pid `product.pid`," +
            " b.pname `product.pname`," +
            " b.market_price `product.marketPrice`," +
            " b.shop_price `product.shopPrice`," +
            " b.image `product.image`," +
            " b.pdesc `product.pdesc`," +
            " b.is_hot `product.isHot`," +
            " b.pdate `product.pdate`," +
            " b.csid `product.csid`" +
            " from cart a " +
            " join product b on a.pid=b.pid" +
            " where uid = #{uid}")
    List<Cart> selectByUid(int uid);

}
